classdef untitled
    %   UNTITLED Summary of this class goes here
    %   Detailed explanation goes here
    
    properties
    end
    
    methods
        function initialize_deployment(obj, apps, pms, pm_per_app)
            obj.apps = apps;
            obj.pms = pms;
            pm_per_app = pm_per_app;
            obj.total_capacity=ones(1,obj.pms)*1200; %in terms of mips
            obj.placement = placement().geneate_placement(obj.pms,obj.apps,pm_per_app);
            obj.update_bare_xml_model(obj.placement);

            % this should be fixed
            obj.initial_cap =  zeros(obj.apps,obj.pms);
            for i=1:obj.pms
                num_vm_for_this_pm = length(find(obj.placement(:,i)==1));
                for j= find(obj.placement(:,i)==1)
                    obj.initial_cap(j,i) = 0.9* obj.total_capacity(i)/num_vm_for_this_pm;
                end
            end

            obj.app_model = {};
            for i=1:obj.apps
                obj.app_model = {obj.app_model{:} App_model()};
                %                App_model()};
                %                App_lin_tracking_model()};
            end

            obj.demand = ones(1,obj.apps).*4100 + randn(1,obj.apps).*250;
            obj.interarr = ones(1,obj.apps).*22 + randn(1,obj.apps).*4;

            %             obj.r_thresholds = ones(1,obj.apps).*14 + randn(1,obj.apps).*4;
            %             obj.max_utils = ones(1,obj.apps).*10;
            obj.r_thresholds = ones(1,obj.apps).*14;
            obj.max_utils = ones(1,obj.apps).*10;
        end

    end %methods
    
end

